package de.karnik.dokobu.persistence;

import java.util.List;

import javax.jdo.annotations.Element;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true")
public class RecipeCategory {
	
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;
	
    @Persistent
	private String name;
    @Persistent(mappedBy = "recipe")
    @Element(dependent = "true")
	private List<Recipe> recipes;
	 
	public List<Recipe> getRecipes() {
		return recipes;
	}

	public void setRecipes( List<Recipe> recipes ) {
		this.recipes = recipes;
	}

	public String getName() {
		return name;
	}

	public void setName( String name ) {
		this.name = name;
	}

	public Key getKey() {
		return key;
	}
	
}
